home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gxgetbit.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  3.7 KB  |  96 lines

  1. /* Copyright (C) 1997, 1998 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gxgetbit.h,v 1.2 2000/09/19 19:00:37 lpd Exp $ */
  20. /* Interface for get_bits_rectangle driver procedure */
  21.  
  22. #ifndef gxgetbit_INCLUDED
  23. #  define gxgetbit_INCLUDED
  24.  
  25. #include "gxbitfmt.h"
  26.  
  27. /* The parameter record typedef is also in gxdevcli.h. */
  28. #ifndef gs_get_bits_params_DEFINED
  29. #  define gs_get_bits_params_DEFINED
  30. typedef struct gs_get_bits_params_s gs_get_bits_params_t;
  31. #endif
  32.  
  33. /*
  34.  * We define the options for get_bits_rectangle here in a separate file
  35.  * so that the great majority of driver implementors and clients, which
  36.  * don't care about the details, don't need to be recompiled if the set
  37.  * of options changes.
  38.  */
  39. typedef gx_bitmap_format_t gs_get_bits_options_t;
  40.  
  41. /*
  42.  * Define the parameter record passed to get_bits_rectangle.
  43.  * get_bits_rectangle may update members of this structure if
  44.  * the options allow it to choose their values, and always updates options
  45.  * to indicate what options were actually used (1 option per group).
  46.  */
  47. struct gs_get_bits_params_s {
  48.     gs_get_bits_options_t options;
  49.     byte *data[32];
  50.     int x_offset;        /* in returned data */
  51.     uint raster;
  52. };
  53.  
  54. /*
  55.  * gx_bitmap_format_t defines the options passed to get_bits_rectangle,
  56.  * which indicate which formats are acceptable for the returned data.  If
  57.  * successful, get_bits_rectangle sets the options member of the parameter
  58.  * record to indicate what options were chosen -- 1 per group, and never the
  59.  * _ANY option.  Note that the chosen option is not necessarily one that
  60.  * appeared in the original options: for example, if GB_RASTER_ANY is the
  61.  * only raster option originally set, the chosen option will be
  62.  * GB_RASTER_STANDARD or GB_RASTER_SPECIFIED.
  63.  *
  64.  * If the options mask is 0, get_bits_rectangle must set it to the
  65.  * complete set of supported options and return an error.  This allows
  66.  * clients to determine what options are supported without actually doing
  67.  * a transfer.
  68.  *
  69.  * All devices must support at least one option in each group, and must
  70.  * support GB_COLORS_NATIVE.
  71.  *
  72.  * NOTE: the current default implementation supports only the following
  73.  * options in their respective groups (i.e., any other options must be
  74.  * supported directly by the device):
  75.  *      GB_DEPTH_8
  76.  *      GB_PACKING_CHUNKY
  77.  *      GB_RETURN_COPY
  78.  * The current default implementation also requires that all devices
  79.  * support GB_PACKING_CHUNKY.  */
  80.  
  81. /* ---------------- Procedures ---------------- */
  82.  
  83. /* Try to implement get_bits_rectangle by returning a pointer. */
  84. int gx_get_bits_return_pointer(P6(gx_device * dev, int x, int h,
  85.                   gs_get_bits_params_t * params,
  86.                   const gs_get_bits_params_t *stored,
  87.                   byte * stored_base));
  88.  
  89. /* Implement get_bits_rectangle by copying. */
  90. int gx_get_bits_copy(P8(gx_device * dev, int x, int w, int h,
  91.             gs_get_bits_params_t * params,
  92.             const gs_get_bits_params_t *stored,
  93.             const byte * src_base, uint dev_raster));
  94.  
  95. #endif /* gxgetbit_INCLUDED */
  96.